//
//  HouseTypeViewModel.m
//  WGFGlobalHouses
//
//  Created by waiguofang on 15/4/23.
//  Copyright (c) 2015年 waiguofang. All rights reserved.
//

#import "HouseTypeViewModel.h"
#import "disDescModel.h"

@implementation HouseTypeViewModel

-(instancetype)initWithDic:(NSDictionary *)dic;
{
    
    
    if (self = [super init])
    {
        self.housingId = [dic[@"housingId"]integerValue];
        self.countryName = dic[@"countryName"];
        self.stateName = dic[@"stateName"];
        self.cityName = dic[@"cityName"];
        self.housingName= dic[@"housingName"];
        
        
        self.totalAmountCNY = dic[@"totalAmountCNY"];
        self.totalAmountUSD = [dic[@"totalAmountUSD"]integerValue];;
        self.zip = [dic[@"zip"]integerValue];
        self.status = dic[@"status"];
        self.decorationName = dic[@"decorationName"];
        self.floor = [dic[@"floor"]integerValue];
        
        
        self.expectRent = [dic[@"expectRent"]floatValue];
        self.expectYield = [dic[@"expectYield"]floatValue];
        self.longitude = [dic[@"longitude"]floatValue];
        self.latitude = [dic[@"latitude"]floatValue];
       

//        self.houseId = dic[@"houseId"];
        self.bedRoom = [dic[@"bedRoom"]integerValue];
        self.bathRoom = [dic[@"bathRoom"]integerValue];
        self.garage = [dic[@"garage"]integerValue];
        self.typeName = dic[@"typeName"];
        self.areaMi = [dic[@"areaMi"]integerValue];
        self.businessNo = dic[@"businessNo"];
        
        
        self.lTypeName = dic[@"lTypeName"];
        self.houseTypeName = dic[@"houseTypeName"];
        self.healthFit = dic[@"healthFit"];
        self.surSchool = dic[@"surSchool"];
        self.surSchoolDetail = dic[@"surSchoolDetail"];
        self.surroundingFac = dic[@"surroundingFac"];
        self.thumb = dic[@"thumb"];
        
        
        self.aroundEnv = dic[@"aroundEnv"];
        self.communityFac = dic[@"communityFac"];
        self.leisureFac = dic[@"leisureFac"];
        self.spfac = dic[@"spfac"];
        self.housingFac = dic[@"housingFac"];
    
        self.houseTagsArr = dic[@"houseTags"];
        self.fangxingPicsArr = dic[@"fangxingPics"];
        self.fangyuanPicsArr = dic[@"fangyuanPics"];
        
        
        self.detail = dic[@"detail"];
        self.detailEnglish = dic[@"detailEnglish"];
        
        
        NSArray *arr = [NSArray arrayWithArray:dic[@"infoDtos"]];
        NSMutableArray *arrM = [NSMutableArray array];
        for (NSDictionary *dic in arr)
        {
            disDescModel *model = [disDescModel disDescModelWithDic:dic];
            [arrM addObject:model];
        }
        self.disDescArr = [NSMutableArray arrayWithArray:arrM];
        
    }
    return self;

}
+(instancetype)houseTypeViewModelWithDic:(NSDictionary *)dic;
{
    return [[self  alloc]initWithDic:dic];
}

@end
